package com.gao.id;

import com.gao.common.Constants;
import com.gao.id.strategy.SnowFlakeId;
import org.springframework.context.annotation.Bean;

import java.util.HashMap;
import java.util.Map;

public class IdContext {

    @Bean
    public Map<Constants.Ids, IdGenerator> idGenerator(SnowFlakeId snowFlakeId) {
        Map<Constants.Ids, IdGenerator> idGeneratorMap = new HashMap<>(8);
        idGeneratorMap.put(Constants.Ids.SnowFlakeId, snowFlakeId);

        return idGeneratorMap;
    }
}
